🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / feature / settings / src / androidMain / kotlin / org / meshtastic / feature / settings / radio / component / PositionConfigScreen.android.kt
Displaying Raw • Download
feature/settings/src/androidMain/kotlin/org/meshtastic/feature/settings/radio/component/PositionConfigScreen.android.kt 13865e7c8b7f9a47cd3b572bd44d8ec355b2d3a9 (13865e7c) Text, 2.68 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.feature.settings.radio.component
Tff7b72import T7ee787android.annotation.SuppressLint
Tff7b72import T7ee787android.os.Build
Tff7b72import T7ee787androidx.compose.material3.Text
Tff7b72import T7ee787androidx.compose.material3.TextButton
Tff7b72import T7ee787androidx.compose.runtime.Composable
Tff7b72import T7ee787androidx.compose.runtime.rememberCoroutineScope
Tff7b72import T7ee787androidx.core.location.LocationCompat
Tff7b72import T7ee787kotlinx.coroutines.launch
Tff7b72import T7ee787org.jetbrains.compose.resources.stringResource
Tff7b72import T7ee787org.meshtastic.core.model.Position
Tff7b72import T7ee787org.meshtastic.core.resources.Res
Tff7b72import T7ee787org.meshtastic.core.resources.position_config_set_fixed_from_phone
Tff7b72import T7ee787org.meshtastic.feature.settings.radio.RadioConfigViewModel
Tf0883e@Composable
Tff7b72actual Tff7b72fun Td2a8ffDeviceLocationButtonTb4b4b4(
Te6edf3viewModelTb4b4b4: Te6edf3RadioConfigViewModelTb4b4b4,
Te6edf3enabledTb4b4b4: Tffa657BooleanTb4b4b4,
Te6edf3onLocationReceivedTb4b4b4: Tb4b4b4(Te6edf3PositionTb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4,
Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3coroutineScope Tff7b72= Te6edf3rememberCoroutineScopeTb4b4b4(Tb4b4b4)
Te6edf3TextButtonTb4b4b4(
Te6edf3enabled Tff7b72= Te6edf3enabledTb4b4b4,
Te6edf3onClick Tff7b72= Tb4b4b4{
Tf0883e@SuppressLintTb4b4b4(Ta5d6ff"Ta5d6ffMissingPermissionTa5d6ff"Tb4b4b4)
Te6edf3coroutineScopeTb4b4b4.Te6edf3launch Tb4b4b4{
Tff7b72val Te6edf3phoneLoc Tff7b72= Te6edf3viewModelTb4b4b4.Te6edf3getCurrentLocationTb4b4b4(Tb4b4b4)
Tff7b72if Tb4b4b4(Te6edf3phoneLoc Tff7b72!Tff7b72= Tff7b72nullTb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3locationInput Tff7b72=
Te6edf3PositionTb4b4b4(
Te6edf3latitude Tff7b72= Te6edf3phoneLocTb4b4b4.Te6edf3latitudeTb4b4b4,
Te6edf3longitude Tff7b72= Te6edf3phoneLocTb4b4b4.Te6edf3longitudeTb4b4b4,
Te6edf3altitude Tff7b72=
Te6edf3LocationCompatTb4b4b4.Te6edf3hasMslAltitudeTb4b4b4(Te6edf3phoneLocTb4b4b4)Tb4b4b4.Te6edf3let Tb4b4b4{
Tff7b72if Tb4b4b4(Tffa657it Tff7b72&Tff7b72& Te6edf3BuildTb4b4b4.Te6edf3VERSIONTb4b4b4.Te6edf3SDK_INT Tff7b72>Tff7b72= Te6edf3BuildTb4b4b4.Te6edf3VERSION_CODESTb4b4b4.Te6edf3UPSIDE_DOWN_CAKETb4b4b4) Tb4b4b4{
Te6edf3phoneLocTb4b4b4.Te6edf3mslAltitudeMetersTb4b4b4.Te6edf3toIntTb4b4b4(Tb4b4b4)
Tb4b4b4} Tff7b72else Tb4b4b4{
Te6edf3phoneLocTb4b4b4.Te6edf3altitudeTb4b4b4.Te6edf3toIntTb4b4b4(Tb4b4b4)
Tb4b4b4}
Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Te6edf3onLocationReceivedTb4b4b4(Te6edf3locationInputTb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}Tb4b4b4,
Tb4b4b4) Tb4b4b4{
Te6edf3TextTb4b4b4(Te6edf3text Tff7b72= Te6edf3stringResourceTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3position_config_set_fixed_from_phoneTb4b4b4)Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.05s